package com.orange.factoryPatterns.factory;

import com.orange.factoryPatterns.config.ShapeConfig;
import com.orange.factoryPatterns.pojo.Circle;
import com.orange.factoryPatterns.pojo.Rectangle;
import com.orange.factoryPatterns.pojo.Shape;
import com.orange.factoryPatterns.pojo.Squere;

//简单工厂
public class SimpleFactory {
    public Shape getShape(String shapeType, ShapeConfig config){
        if(shapeType=="circle"){
            Circle circle = new Circle();
            //进行配置根据config类中数据
            return circle;
        }
        if(shapeType=="squre"){
            Squere squere = new Squere();
            //进行配置根据config类中数据
            return squere;
        }
        if(shapeType=="rectangle"){
            Rectangle rectangle = new Rectangle();
            //进行配置根据config类中数据
            return rectangle;
        }
        return null;
    }
}
